<template>
  <div class="app">
    根组件 {{ content }}
    <hr />
    <father></father>
    <hr />
    === 父组件获取:{{ value }}===
    <BaseSelect @changetext="changetext"></BaseSelect>
    === 父组件获取:{{ value1 }}===
    <BaseSelect @changetext="changetext1"></BaseSelect>
    <hr />
    <BaseSelect ref="refselect"></BaseSelect>
  </div>
</template>
<script>
import father from './provide/father.vue'
import BaseSelect from './provide/BaseSelect.vue'
export default {
  name: '',
  //固定语法,记住就行
  provide () {
    return {
      content: this.content,
      say: this.say
    }
  },
  components: { father, BaseSelect },
  data () {
    return {
      content: '我是根组件app',
      value: '',
      value1: ''
    }
  },
  created () {
  },
  computed: {

  },
  methods: {
    say (msg) {
      // console.log(11);
      this.content = msg
    },
    changetext (change) {
      this.value = change
    },
    changetext1 (change) {
      this.value1 = change
    }
  },
  mounted () {
    console.log(this);
  }
}
</script>
<style lang='less'  scoped>
</style>
